package com.xiaohudie.JiChu;

/**
 * @Author xiao hu die
 * @Date 2022/1/11 21:46
 * @Version 1.0
 */
public class StaticMethod {
 /**定义静态变量*/
    public static Integer a =0;
 /**定义静态方法*/
 public static void method1(){
     a++;
     System.out.println("method1    "+a);
 }
 /**定义实例方法*/
 public void method2(){
     a=a+2;
     System.out.println("method2   "+a);

 }
 /**定义一个静态方法*/
 public static void method3(){
     a=a+3;
     System.out.println("method3  "+a);

 }

    public static void main(String[] args) {
        StaticMethod  staticMethod =new StaticMethod();
        /**直接调用静态方法*/
        StaticMethod.method1();
        staticMethod.method2();
        staticMethod.method3();

    }
}
